import { ColumnProps } from '~/library/components/ProTable/interface'
import { Procure } from '~/src/api/interface/procure'
import { checkFlag, deliveryStatus } from '~/src/utils/serviceDict'

export const ProcureSheetColumns: ColumnProps<Procure.ProcureSheet>[] = [
  { type: 'index', label: '序号', width: 60 },
  {
    prop: 'orderDate',
    label: '订单日期',
    align: 'left',
    minWidth: 164,
    search: {
      el: 'date-picker',
      label: '单据日期',
      key: 'timeValue',
      order: 1,
      props: {
        type: 'datetimerange',
        format: 'YYYY-MM-DD HH:mm',
        valueFormat: 'YYYY-MM-DD HH:mm',
      },
    },
  },
  { prop: 'orderNo', label: '单据编号', minWidth: 180, align: 'left', search: { el: 'input' } },
  {
    prop: 'supplierName',
    label: '供应商',
    minWidth: 120,
    // 发请求渲染数据
    // enum: () => getSupplierList({ pageNum: 1, pageSize: 9999 }),
    align: 'left',
    search: { el: 'select' },
    // fieldNames: { label: "name", value: "id" }
  },
  // {
  //   prop: "amount",
  //   label: "订单金额",
  //   minWidth: 120,
  //   align: "left",
  //   enum: timeType,
  //   search: {
  //     el: "select",
  //     label: "日期类型",
  //     key: "timeType",
  //     order: 0,
  //     defaultValue: 0
  //   }
  // },
  { prop: 'amount', label: '订单金额', minWidth: 120, align: 'left', search: { el: 'select' } },
  { prop: 'checkFlag', label: '单据状态', minWidth: 120, enum: checkFlag, align: 'left', search: { el: 'select' } },
  { prop: 'deliveryStatus', label: '收货状态', minWidth: 120, enum: deliveryStatus, align: 'left' },
  { prop: 'createTime', label: '创建时间', minWidth: 164, align: 'left' },
  { prop: 'remark', label: '备注', minWidth: 180, align: 'left', search: { el: 'input' } },
  { prop: 'operation', label: '操作', width: 160 },
]
